import re

# group by brace

batRegex = re.compile(r'Bat(wo){0}man')
mo = batRegex.search('The Adventures of Batman')
print(mo.group())
print("**********".center(20))
mo = batRegex.search('The Adventures of Batwoman')
print(mo)
print("**********".center(20))
mo = batRegex.search('The Adventures of Batwowoman')
print(mo)
print("**********".center(20))

batRegex = re.compile(r'Bat(wo){0,1}man')
mo = batRegex.search('The Adventures of Batman')
print(mo)
print("**********".center(20))
mo = batRegex.search('The Adventures of Batwoman')
print(mo)
print("**********".center(20))
mo = batRegex.search('The Adventures of Batwowoman')
print(mo)
print("**********".center(20))
